import { default as request, cloud } from '@/framework/utils/request'

export default {
  // 查询数据源监控列表
  listDatabaseMonitor(query) {
    return request({
      url: cloud.interfacePlatform + '/interfaceDatabaseMonitor/page',
      method: 'get',
      params: query
    })
  },

  // 查询数据源监控详细
  getDatabaseMonitor(id) {
    return request({
      url:
        cloud.interfacePlatform + '/interfaceDatabaseMonitor/detail?id=' + id,
      method: 'get'
    })
  },

  // 新增数据源监控
  addDatabaseMonitor(data) {
    return request({
      url: cloud.interfacePlatform + '/interfaceDatabaseMonitor/add',
      method: 'post',
      data: data
    })
  },

  // 修改数据源监控
  updateDatabaseMonitor(data) {
    return request({
      url: cloud.interfacePlatform + '/interfaceDatabaseMonitor/edit',
      method: 'post',
      data: data
    })
  },

  // 删除数据源监控
  delDatabaseMonitor(id) {
    return request({
      url: cloud.interfacePlatform + '/interfaceDatabaseMonitor/delete',
      method: 'post',
      data: { ids: id }
    })
  },

  // 删除数据源监控
  deleteById(data) {
    return request({
      url: cloud.interfacePlatform + '/interfaceDatabaseMonitor/deleteById',
      method: 'post',
      data
    })
  },

  // 测试数据源连接
  connect(data) {
    return request({
      url: cloud.interfacePlatform + '/interfaceDatabaseMonitor/connect',
      method: 'post',
      data: data
    })
  }

}
